<template lang="pug">
  view-box.unionDongtai
    .message(v-for="msg in unionMessage")
      span.point
      span.time {{msg.addtime}}
      span.user {{msg.remark}}
      //- span(v-if="msg.type==='enter'") 加入工会
      //- span(v-if="msg.type==='leave'") 离开工会
      //- span(v-if="msg.type==='createUnion'") 创建工会
      //- span(v-if="msg.type!=='createUnion'") 余额{{msg.balance}}豆
      //- span.union-name(v-if="msg.type==='createUnion'") {{unionname}}
</template>

<script>
import memberService from '@/api/member'

export default {
  name: 'unionDongtai',
  data () {
    return {
      pagination: {
        page: 1,
        pagesize: 10
      },
      unionname: '我的工会',
      unionMessage: []
    }
  },
  created () {
    document.title = "工会动态"
    this.getUnionMessage()
  },
  methods: {
    getUnionMessage () {
      memberService.GuildTrendList(this.pagination)
        .then(res => {
          this.unionMessage = res.result.list
        })
    }
  },
  mounted () {
  }
}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="less">
.unionDongtai{
  padding:0px 10px;
}
  .message{
    text-align: left;
    border-bottom:1px solid #ccc;
    padding:10px;
    font-size: 16px;
    span.point{
      display: inline-block;
      width: 10px;
      height: 10px;
      border-radius: 5px;
      background-color: #f90;
    }
    span.user{
      color:green;
    }
    .union-name{
      color:#f90;
    }
  }
  
</style>
